import iViewTheme from 'iview-layout-themes'
const axios = iViewTheme.util.apiRequest

/*
管理端登录接口
 */
export const login = ({ userName, password }) => {
  const data = JSON.stringify({
    username: userName,
    password: password
  })
  return axios.request({
    url: '/api/uc/sc/loginService/userLogin',
    data: data,
    type: 'post'
  })
}
export const getUserInfo = () => {
  return axios.request({
    url: '/api/as/info',
    method: 'post',
    data: { a: 1 }
  })
}
export const getJavaMenus = (menu_id) => {
  return axios.request({
    url: '/api/ac/sc/menuService/getVueMenuList',
    data: { menu_id: menu_id },
    type: 'get'
  })
}
export const getPhpMenus = () => {
  return axios.request({
    url: '/wl/menus',
    type: 'get',
    php: true
  })
}
// 事项列表
export const findProjectInfoList = (param) => {
  return axios.request({
    url: '/api/as/ggc/administrationProject/findProjectInfoList',
    method: 'post',
    data: param
  })
}
// 删除
export const deleteProject = (param) => {
  return axios.request({
    url: '/api/as/ggc/administrationProject/deleteProject',
    method: 'post',
    data: param

  })
}
export const getAllState = () => {
  return axios.request({
    url: '/api/as/ggc/extractCompany/getAllState',
    type: 'get',
    php: true
  })
}
// 列表数量
export const ProjectNumList = () => {
  return axios.request({
    url: '/api/as/ggc/extractCompany/ProjectNumList',
    type: 'get',
    php: true
  })
}
// 添加
export const insertProject = (param) => {
  return axios.request({
    url: '/api/as/ggc/administrationProject/insertProjectInfo',
    method: 'post',
    data: param

  })
}
// 编辑
export const updateProject = () => {
  return axios.request({
    url: '/api/as/ggc/extractCompany/updateProject',
    type: 'get',
    php: true
  })
}
// 通过更改状态
export const updataAdoptState = (param) => {
  return axios.request({
    url: '/api/ac/ggc/ProjectlMapService/updataAdoptState',
    method: 'post',
    data: param
  })
}// 拒绝更改状态
export const updataRefuseState = (param) => {
  return axios.request({
    url: '/api/ac/ggc/ProjectlMapService/updataRefuseState',
    method: 'post',
    data: param
  })
}

// 企业项目列表
export const getCompanyList = (param) => {
  return axios.request({
    url: '/api/as/ggc/extractCompany/getCompanyList',
    method: 'post',
    data: param
  })
}
// 新增企业项目并更改状态
export const updateStateById = (param) => {
  return axios.request({
    url: '/api/ac/ggc/ProjectlMapService/updateStateById',
    method: 'post',
    data: param
  })
}
// 查看上传资料
export const lookUploadingInfo = (param) => {
  return axios.request({
    url: '/api/as/ggc/administrationProject/lookUploadingInfo',
    method: 'post',
    data: param
  })
}
